package com.bookcloud.java21.chapter12.泛型类123;

public class PairExample2 {
  public static void main(String[] args) {
    // Pair实例使用类的演示
    Pair2<String, String> pair = new Pair2<String, String>("姓名", "张三");
    String key = pair.getKey();
    String value = pair.getValue();
    System.out.println("key:" + key + ",value:" + value);
    System.out.println("=================");
    // 实例化Pair对象pair2,age=12
    Pair2<String, Integer> pair2 = new Pair2<String, Integer>("年龄", 12);
    String ageKey = pair2.getKey();
    int ageVal = pair2.getValue();
    System.out.println("ageKey:" + ageKey + ",ageVal:" + ageVal);
  }
}
